{% import 'snippets/links.jinja' as links %}


{% if charts is undefined %}
	{% set charts = dbc.get_charts_tracks(filterkeys,limitkeys) %}
{% endif %}

{% set charts_14 = charts | fixlength(14) %}


<div class="tiles">
	{% if charts_14[0] is none %}
		{% include 'icons/nodata.jinja' %}
	{% endif %}
	{% for entry in charts_14 %}
		{% if entry is not none %}
			{% set track = entry.track %}
			{% set rank = entry.rank %}
			{% set scrobbles = entry.scrobbles %}
			<div class="tile">
			<a href="{{ links.url(track) }}">
				<div class="lazy" data-bg="{{ images.get_track_image(track) }}"'>
					<span class='stats'>#{{ rank }}</span> <span>{{ track.title }}</span>
					{% if settings['SHOW_PLAY_NUMBER_ON_TILES'] %}
						<p class="scrobbles"><span>{{ scrobbles }} {{ 'play' if scrobbles == 1 else 'plays' }}</span> </p>
					{% endif %}
				</div>
			</a>
			</div>
		{% else %}
			<div></div>
		{% endif %}
	{% endfor %}

</div>
